#include <main.h>

void setup_digital_tube() {
    digital_tube.begin();
    digital_tube.set_num(0);
}

void loop_digital_tube() {
    digital_tube.run();
}

void setup_button() {
    pinMode(F_BUTTON_PIN, INPUT);
    attachInterrupt(F_BUTTON_PIN, []() {
        digital_tube.set_num(++press_times);
    }, FALLING);
    
    pinMode(R_BUTTON_PIN, INPUT);
    attachInterrupt(R_BUTTON_PIN, []() {
        digital_tube.set_num(++press_times);
    }, RISING);
    
    pinMode(F_R_BUTTON_PIN, INPUT);
    attachInterrupt(F_R_BUTTON_PIN, []() {
        digital_tube.set_num(++press_times);
    }, CHANGE);
    
}




void setup() {
    setup_digital_tube();
    setup_button();
}

void loop() {
    loop_digital_tube();
}
